home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / basic / mildred / mildred.lha / lha / SplitTests.lha / SpeedTest.ascii < prev    next >
Text File  |  2000-02-23  |  3KB  |  110 lines

  1. WBStartup
  2. InitBank 0,1280*512,$10000
  3. CludgeBitMap 0,1280,512,8,Bank(0)
  4. InitPalette 0,256
  5. LoadBitMap 0,"Pic.128",0
  6. MBitmap 0,1280,960
  7. MBitmapWindow 0,1,0,960-512,1280,512
  8. MPlanar16ToBitmap 1,Bank(0),1280,512,1280,512
  9. InitBank 0,320*240,$10002
  10. CludgeBitMap 0,320,240,8,Bank(0)
  11. InitBank 1,320*240,$10002
  12. CludgeBitMap 1,320,240,8,Bank(1)
  13. Screen 0,0,0,320,240,8,0,"Game",0,0,0
  14. ShowPalette 0
  15.  
  16. MBitmap 1,320,240
  17. NEWTYPE.OffsetList
  18.   LineWidth.w
  19.   X1Offset.w
  20.   X2Offset.w
  21.   SourceModuloOffset.w
  22. End NEWTYPE
  23. Dim leftrows1.OffsetList(40)
  24. Dim leftrows2.OffsetList(40)
  25. Dim rightrows1.OffsetList(40)
  26. Dim rightrows2.OffsetList(40)
  27. leftrows1(0)\LineWidth=64-24,0,0,0
  28. leftrows2(0)\LineWidth=64,0,0,0
  29. rightrows1(0)\LineWidth=1,0,0,0
  30. rightrows2(0)\LineWidth=24,0,0,0
  31. For y=1 To 39
  32.   leftrows1(y)\LineWidth=64-24-y
  33.   leftrows1(y)\X1Offset=0
  34.   leftrows1(y)\X2Offset=0
  35.   leftrows1(y)\SourceModuloOffset=0
  36.   leftrows2(y)\LineWidth=64-y
  37.   leftrows2(y)\X1Offset=0
  38.   leftrows2(y)\X2Offset=0
  39.   leftrows2(y)\SourceModuloOffset=0
  40.   rightrows1(y)\LineWidth=y+1
  41.   rightrows1(y)\X1Offset=-1
  42.   rightrows1(y)\X2Offset=-1
  43.   rightrows1(y)\SourceModuloOffset=0
  44.   rightrows2(y)\LineWidth=24+y
  45.   rightrows2(y)\X1Offset=-1
  46.   rightrows2(y)\X2Offset=-1
  47.   rightrows2(y)\SourceModuloOffset=0
  48. Next
  49.  
  50. Mc2pWindow 0,224,80,1280,320,240
  51. Mc2pWindow 1,96,80,1280,320,240
  52. Mc2pWindow 2,96,80,320,320,240
  53. Mc2pWindow 3,128,80,320,320,240
  54. Mc2pWindow 4,64,40,1280,320,240
  55. Mc2pWindow 5,64,40,320,320,240
  56. mousemult.q=1070/320
  57. its.l=0
  58. buf.b=0
  59. Mc2p 1,MBitmapPtr(0,700,0),MGenericPtr(224 LSR 3,0,Bank(0),40)
  60. Mc2p 1,MBitmapPtr(0,700,0),MGenericPtr(224 LSR 3,0,Bank(1),40)
  61. MZoom 0,0,12,12,0,160,96,80,False,0
  62. Mc2p 2,MBitmapPtr(0,160,1),MGenericPtr(0,160,Bank(0),40)
  63. Mc2p 2,MBitmapPtr(0,160,1),MGenericPtr(0,160,Bank(1),40)
  64. Use BitMap 0 : Line 319-8,0,320-96+8,79,0
  65. Use BitMap 1 : Line 319-8,0,320-96+8,79,0
  66. ShowBitMap 1-buf
  67. VWait
  68. ResetTimer
  69. Repeat
  70.   player1x=SMouseX*mousemult
  71.   player1y=SMouseY*mousemult
  72.   player2x=(1280-238)-player1x
  73. ;  player2y=(960-160)-player1y
  74. ;player2x=player1x
  75. player2y=player1y
  76.   Mc2p 0,MBitmapPtr(player1x,player1y,0),Bank(buf)
  77.   Mc2p 1,MBitmapPtr(player1x,player1y+80,0),MGenericPtr(0,80,Bank(buf),40)
  78.   Mc2p 0,MBitmapPtr(player2x,player2y+80,0),MGenericPtr(96 LSR 3,160,Bank(buf),40)
  79.   Mc2p 1,MBitmapPtr(player2x+128,player2y,0),MGenericPtr(224 LSR 3,80,Bank(buf),40)
  80.   MScroll player1x+96+64,player1y+80,64,40,96+64,80,0,&leftrows1(0)
  81.   MScroll player1x+96,player1y+80+40,64,40,96,80+40,0,&leftrows2(0)
  82.   MScroll player2x+128-24,player2y,64,40,224-24,80,0,&rightrows2(0)
  83.   MScroll player2x+64,player2y+40,64,40,96+64,80+40,0,&rightrows1(0)
  84.   Mc2p 5,MBitmapPtr(96,80+40,1),MGenericPtr(96 LSR 3,80+40,Bank(buf),40)
  85.   Mc2p 5,MBitmapPtr(96+64,80,1),MGenericPtr((96+64) LSR 3,80,Bank(buf),40)
  86.   Mc2p 4,MBitmapPtr(player1x+96,player1y+80,0),MGenericPtr(96 LSR 3,80,Bank(buf),40)
  87.   Mc2p 4,MBitmapPtr(player2x+64,player2y+40,0),MGenericPtr(160 LSR 3,80+40,Bank(buf),40)
  88.   its+1
  89.   ShowBitMap buf
  90. ;  VWait
  91.   buf=1-buf
  92. Until Joyb(0)=3
  93. ;Report
  94. t=Timer
  95. t=Max(t,1)
  96. its=Max(its,1)
  97. a.q=50.0/(t/its)
  98. WBenchToFront_
  99. WbToScreen 1
  100. Window 2,16,16,300,40,0,"Test results",1,0
  101. WindowOutput 2
  102. NPrint a," frames per second"
  103. NPrint " "
  104. NPrint "Press mouse/joy button..."
  105. VWait 20
  106. Repeat
  107. Until Joyb(0)<>0 OR Joyb(1)<>0
  108. End
  109.  
  110.